package org.example.controller;


import org.example.entity.Lexicon;

import org.example.service.IFenYeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/fenYe")
public class FenYeController {

    private IFenYeService fen;

    public FenYeController(IFenYeService fen) {
        this.fen = fen;
    }

    @GetMapping
    public List<Lexicon> fenYe(@RequestParam(defaultValue = "1") Integer page,
                               @RequestParam(defaultValue = "10")Integer limit){

        List<Lexicon> list = fen.fenYeAll(page, limit);
        return list;

    }
}
